#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read<int>()
#define inn read<ll>()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

template <typename T>
T read(){
	T x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

priority_queue<ll,vector<ll>,greater<ll> > q;
unordered_map<ll,ll> f;
ll ans,n,c0,c1,tot;

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = inn;c0 = inn;c1 = inn;
	if(!c0 && !c1) return puts("0"),0;
	if(!c0 || !c1) return printf("%lld\n",(n-1) * max(c0,c1)),0;
	q.push(0); f[0] = 1; tot = 1;
	while(tot < n){
		ll x = q.top(),t = min(n-tot,f[x]); q.pop();
		f[x] -= t; tot += t; ans += (c0 + c1) * t + x * t;
		if(!f[x+c0]) q.push(x+c0),f[x+c0] = t;
		else f[x+c0] += t;
		if(!f[x+c1]) q.push(x+c1),f[x+c1] = t;
		else f[x+c1] += t;
	}
	printf("%lld\n",ans);
	return 0;
}

